package com.ruoyi.system.api;

import java.util.List;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysMenu;
import com.ruoyi.system.api.factory.RemoteSysMenuFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;


/**
 * 菜单权限微服务接口
 * 
 * @author ruoyi
 * @date 2023-04-27
 */
@FeignClient(contextId = "remoteSysMenuService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteSysMenuFallbackFactory.class)
public interface RemoteSysMenuService
{
    /**
     * 查询菜单权限
     * 
     * @param menuId 菜单权限主键
     * @return 菜单权限
     */
    @GetMapping("/inner/menu/{menuId}")
    public R<SysMenu> selectSysMenuByMenuId(@PathVariable("menuId") Long menuId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 查询菜单权限列表
     * 
     * @param sysMenu 菜单权限
     * @return 菜单权限集合
     */
    @PostMapping("/inner/menu/list")
    public R<List<SysMenu>> selectSysMenuList(SysMenu sysMenu, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 新增菜单权限
     * 
     * @param sysMenu 菜单权限
     * @return 结果
     */
    @PostMapping("/inner/menu")
    public R<Integer> insertSysMenu(@RequestBody SysMenu sysMenu, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 修改菜单权限
     * 
     * @param sysMenu 菜单权限
     * @return 结果
     */
    @PutMapping("/inner/menu")
    public R<Integer> updateSysMenu(@RequestBody SysMenu sysMenu, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 批量删除菜单权限
     * 
     * @param menuIds 需要删除的菜单权限主键集合
     * @return 结果
     */
    @DeleteMapping("/inner/menu/{menuIds}")
    public R<Integer> deleteSysMenuByMenuIds(@PathVariable("menuIds") Long[] menuIds, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
